<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>window对象</title>
		<script>
			console.dir(window);
			alert(window.screen.height+","+window.screen.width);
			alert(window.outerHeight+","+window.outerWidth);
			alert(window.location);
			console.log(window.history);
			function closeWin(){
				if(window.confirm("你真的要关？"))
				  window.close();
			}
			function openWin(){
				window.open("https://www.bdqn.cn","bdqn","height=200px,width=200px,left=100px,top=300px,resizable=no");
			}
			function goBack(){
				window.history.back();
			}
			function doRefresh(){
				alert(window.location.host);
				alert(window.location.hostname);
				alert(window.location.href);
				window.location.reload();
			}
			function goBaidu(){
				window.location.replace("https://www.baidu.com");
			}
		</script>
	</head>
	<body>
		<button type="button" onclick="closeWin()">关闭</button>
		<button type="button" onclick="openWin()">打开广告</button>
		<button type="button" onclick="goBack()">返回</button>
		
		<button type="button" onclick="doRefresh()">刷新</button>
		
		<button type="button" onclick="goBaidu()">去百度</button>
	</body>
</html>